package com.xr.controller;



import com.alibaba.dubbo.config.annotation.Reference;
import com.xr.constant.MessageConstant;
import com.xr.result.Result;
import com.xr.service.OrderService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@RequestMapping("order")
public class OrderController {

    @Reference
    private OrderService orderService;

    @RequestMapping("/queryAll")
    public Result queryAll(Integer id){
        try{
            Map<String, Object> byId = orderService.queryAll(id);
            return new Result(true, MessageConstant.QUERY_ORDER_SUCCESS,byId);
        }catch (Exception e){
            e.printStackTrace();
        }
        return new Result(false,MessageConstant.QUERY_ORDER_FAIL);
    }

}
